/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entitys;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author RIVERA
 */
@Entity
@Table(name = "persona", catalog = "drugstore", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Persona.findAll", query = "SELECT p FROM Persona p WHERE p.idDrogueria=:iddrogueria"),
    @NamedQuery(name = "Persona.findByIdPersona", query = "SELECT p FROM Persona p WHERE p.idPersona = :idPersona AND p.idDrogueria=:iddrogueria"),
    @NamedQuery(name = "Persona.findByIdCargo", query = "SELECT p FROM Persona p WHERE p.idCargo = :idCargo"),
    @NamedQuery(name = "Persona.findByIdDrogueria", query = "SELECT p FROM Persona p WHERE p.idDrogueria = :idDrogueria"),
    @NamedQuery(name = "Persona.findByNombrePersona", query = "SELECT p FROM Persona p WHERE p.nombrePersona = :nombrePersona"),
    @NamedQuery(name = "Persona.findByApellidoPersona", query = "SELECT p FROM Persona p WHERE p.apellidoPersona = :apellidoPersona"),
    @NamedQuery(name = "Persona.findByPassPersona", query = "SELECT p FROM Persona p WHERE p.passPersona = :passPersona"),
    @NamedQuery(name = "Persona.findByTelefonoPersona", query = "SELECT p FROM Persona p WHERE p.telefonoPersona = :telefonoPersona"),
    @NamedQuery(name = "Persona.findByDireccionPersona", query = "SELECT p FROM Persona p WHERE p.direccionPersona = :direccionPersona"),
    @NamedQuery(name = "Persona.findByMailPersona", query = "SELECT p FROM Persona p WHERE p.mailPersona = :mailPersona")})
public class Persona implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PERSONA", nullable = false)
    private Long idPersona;
    @Basic(optional = false)
    @Column(name = "ID_CARGO", nullable = false)
    private int idCargo;
    @Basic(optional = false)
    @Column(name = "ID_DROGUERIA", nullable = false)
    private int idDrogueria;
    @Basic(optional = false)
    @Column(name = "NOMBRE_PERSONA", nullable = false, length = 15)
    private String nombrePersona;
    @Basic(optional = false)
    @Column(name = "APELLIDO_PERSONA", nullable = false, length = 15)
    private String apellidoPersona;
    @Basic(optional = false)
    @Column(name = "PASS_PERSONA", nullable = false, length = 25)
    private String passPersona;
    @Basic(optional = false)
    @Column(name = "TELEFONO_PERSONA", nullable = false, length = 10)
    private String telefonoPersona;
    @Basic(optional = false)
    @Column(name = "DIRECCION_PERSONA", nullable = false, length = 25)
    private String direccionPersona;
    @Basic(optional = false)
    @Column(name = "MAIL_PERSONA", nullable = false, length = 25)
    private String mailPersona;
    
    

    public Persona() {
    }

    public Persona(Long idPersona) {
        this.idPersona = idPersona;
    }

    public Persona(Long idPersona, int idCargo, int idDrogueria, String nombrePersona, String apellidoPersona, String passPersona, String telefonoPersona, String direccionPersona, String mailPersona) {
        this.idPersona = idPersona;
        this.idCargo = idCargo;
        this.idDrogueria = idDrogueria;
        this.nombrePersona = nombrePersona;
        this.apellidoPersona = apellidoPersona;
        this.passPersona = passPersona;
        this.telefonoPersona = telefonoPersona;
        this.direccionPersona = direccionPersona;
        this.mailPersona = mailPersona;
    }

    public Long getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Long idPersona) {
        this.idPersona = idPersona;
    }

    public int getIdCargo() {
        return idCargo;
    }

    public void setIdCargo(int idCargo) {
        this.idCargo = idCargo;
    }

    public int getIdDrogueria() {
        return idDrogueria;
    }

    public void setIdDrogueria(int idDrogueria) {
        this.idDrogueria = idDrogueria;
    }

    public String getNombrePersona() {
        return nombrePersona;
    }

    public void setNombrePersona(String nombrePersona) {
        this.nombrePersona = nombrePersona;
    }

    public String getApellidoPersona() {
        return apellidoPersona;
    }

    public void setApellidoPersona(String apellidoPersona) {
        this.apellidoPersona = apellidoPersona;
    }

    public String getPassPersona() {
        return passPersona;
    }

    public void setPassPersona(String passPersona) {
        this.passPersona = passPersona;
    }

    public String getTelefonoPersona() {
        return telefonoPersona;
    }

    public void setTelefonoPersona(String telefonoPersona) {
        this.telefonoPersona = telefonoPersona;
    }

    public String getDireccionPersona() {
        return direccionPersona;
    }

    public void setDireccionPersona(String direccionPersona) {
        this.direccionPersona = direccionPersona;
    }

    public String getMailPersona() {
        return mailPersona;
    }

    public void setMailPersona(String mailPersona) {
        this.mailPersona = mailPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPersona != null ? idPersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Persona)) {
            return false;
        }
        Persona other = (Persona) object;
        if ((this.idPersona == null && other.idPersona != null) || (this.idPersona != null && !this.idPersona.equals(other.idPersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entitys.Persona[ idPersona=" + idPersona + " ]";
    }
    
}
